﻿<phone:PhoneApplicationPage 
    x:Class="TravelWallet.ListSelectionPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:local="clr-namespace:TravelWallet"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">
    <UserControl.Resources>
        <!--<DataTemplate x:Key="movieListHeader">
            <TextBlock Text="new releases" Style="{StaticResource PhoneTextTitle1Style}"/>
        </DataTemplate>-->
        <local:DebugBindingConverter x:Key="DebugBindingConverter"/>
        <Style x:Key="JumpListStyle" TargetType="phone:LongListSelector">
            <Setter Property="ItemTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <Border Background="{StaticResource PhoneAccentBrush}"  Width="99" Height="99" Margin="6" IsHitTestVisible="{Binding HasItems}">
                            <TextBlock Text="{Binding Letter}" 
                                       FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                       FontSize="36"
                                       Margin="{StaticResource PhoneTouchTargetOverhang}"
                                       Foreground="{StaticResource PhoneForegroundBrush}"                                        
                                       VerticalAlignment="Bottom"/>
                        </Border>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="TRAVEL WALLET" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <phone:LongListSelector x:Name="lls_Selector" 
                                    Loaded="lls_Selector_Loaded" 
                                    SelectionChanged="lls_Selector_SelectionChanged" 
                                    Background="Transparent" 
                                    IsGroupingEnabled="True"
                                    
                                    LayoutMode="List"
                                    Margin="0"
                                    JumpListStyle="{StaticResource JumpListStyle}"
                                    >
                <!--<LongListSelector.GroupItemsPanel>
                    <ItemsPanelTemplate>
                        <toolkit:WrapPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </phone:LongListSelector.GroupItemsPanel>-->
                    <!--<phone:LongListSelector.GroupItemTemplate>
                   
                </phone:LongListSelector.GroupItemTemplate>-->
                <phone:LongListSelector.GroupHeaderTemplate>
                    <DataTemplate>
                        <Border >
                            <Border Width="60" Height="60" Background="{StaticResource PhoneAccentBrush}" HorizontalAlignment="Left" Margin="0,6,0,0">
                                <TextBlock Text="{Binding Letter}"  
                                           Foreground="{StaticResource PhoneForegroundBrush}" 
                                           Style="{StaticResource PhoneTextExtraLargeStyle}"
                                           VerticalAlignment="Bottom" Margin="12,0,12,2" FontSize="36" HorizontalAlignment="Stretch" />
                            </Border>
                        </Border>
                    </DataTemplate>
                </phone:LongListSelector.GroupHeaderTemplate>
                <phone:LongListSelector.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Converter={StaticResource DebugBindingConverter}}"
                                   Style="{StaticResource PhoneTextNormalStyle}" FontSize="32" Margin="12,2" />
                        </StackPanel>
                    </DataTemplate>
                </phone:LongListSelector.ItemTemplate>
            </phone:LongListSelector>

        </Grid>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="btn_Add" Click="btn_Add_Click" IconUri="/Images/appbar.add.rest.png" Text="Add"/>
          
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
